package com.itheima.api.string.api;

/**
 * @author Anomaly
 * @date 2022/12/6 17:26
 */
public class ApiDemo {
    public static void main(String[] args) {
        String name = "中国China";
        System.out.println(name.length());
        System.out.println(name.charAt(1));
        String name1 = "Java是世界上最好的语言";
        System.out.println(name1.substring(1, 3));
        System.out.println(name1.substring(5));

        System.out.println(name1.replace("Java", "Python"));
        System.out.println(name1.contains("世界"));
        System.out.println(name1.startsWith("Jav"));

        String name3 = "string1,string2,string3,,string4";
        String[] strings = name3.split(",");
        for (int i = 0; i < strings.length; i++) {
            System.out.println(strings[i]);
        }
    }
}
